import "package:flutter/material.dart";
import "package:myapp/_common/UListTitle.dart";

TextStyle leadingTitleTextStyle = const TextStyle(
  fontSize: 16,
  color: Color(0xff1c1c1c),
  fontWeight: FontWeight.bold,
);
TextStyle trailingTitleTextStyle = const TextStyle(
  fontSize: 13,
  color: Color(0xff94969a),
);
Icon trailingIcon = const Icon(
  Icons.arrow_forward_ios,
  size: 16,
  color: Color(0xff94969a),
);

/// 影视模块的标题栏
class MovieTitleBar extends StatelessWidget {
  final String leadingTitle;
  final String? trailingTitle;
  const MovieTitleBar({
    super.key,
    required this.leadingTitle,
    this.trailingTitle,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
        color: Color(0xfffffffd),
      ),
      padding: const EdgeInsets.only(left: 12, right: 12, bottom: 6),
      child: UListTitle(
        leading: Text(
          leadingTitle,
          style: leadingTitleTextStyle,
        ),
        trailing: trailingTitle != null
            ? Row(
                children: [
                  Text(trailingTitle ?? '', style: trailingTitleTextStyle),
                  trailingIcon,
                ],
              )
            : const SizedBox.shrink(),
      ),
    );
  }
}
